<?php

namespace CMBUBank\UBank\Response\Account;

use CMBUBank\Http\Response;
use CMBUBank\UBank\Response\UBankBaseResponse;

class AccountHandleAccountInfoResponse extends UBankBaseResponse
{
    protected $responseCode = ['ntqacinfz'];

    protected function format(): Response
    {
        parent::format();

        if (is_array($this->bussList) and count($this->bussList) == 1) {
            $this->bussList = array_shift($this->bussList);
        }

        return $this;
    }

    /**
     * @return array
     */
    public function getAccountInfo(): array
    {
        return $this->bussList;
    }
}